import http from '../util/request.js'

export default {
    // 切换点赞状态
    toggleGive: (giveData) => {
        console.log(giveData);
        return http({
            url: 'api/give/toggle',
            method: 'post',
            data: giveData,
            headers: {
                'Content-Type': 'application/json'
            }
        });
    },

    // 检查点赞状态
    checkLikeStatus: (userId, postId) => {
        return http({
            url: 'api/give/check/'+userId+'/'+postId,
            method: 'get',
        });
    },

    // 获取点赞数量
    getLikeCount: (postId) => {
        return http({
            url: `api/give/count/`+postId,
            method: 'get'
        });
    }
};